﻿using System;
using System.Drawing;
using System.Linq;

namespace Furesoft.Styling.Functions
{
    public class ColorFunctions
    {
        public static Color hsl(Number hue, Number saturation, Number luminosity)
        {
            return new HSLColor { Hue = hue.ToDouble(), Saturation = saturation.ToDouble(), Luminosity = luminosity.ToDouble() };
        }
        public static Color hsla(Number hue, Number saturation, Number luminosity, Number alpha)
        {
            return new HSLColor { Hue = hue.ToDouble(), Saturation = saturation.ToDouble(), Luminosity = luminosity.ToDouble(), Alpha = alpha.ToByte() };
        }
        public static Color rgb(Number r, Number g, Number b)
        {
            return Color.FromArgb(r.ToInt(), g.ToInt(), b.ToInt());
        }
        public static Color argb(Number a, Number r, Number g, Number b)
        {
            return Color.FromArgb(a.ToByte(), r.ToInt(), g.ToInt(), b.ToInt());
        }
    }
}
